package service.impl;

import dao.impl.UserDaoImpl;
import model.User;
import service.UserService;
import util.BCryptUtil;

public class UserServicesImpl implements UserService {
    @Override
    public User userlogin(String name,String password) {
        UserDaoImpl userDao = new UserDaoImpl();
        User userLogin = userDao.findByUserName(name);
        boolean verify = BCryptUtil.verify(password, userLogin.getPassword());
        if (verify){
            return userLogin;
        }else return null;
    }
}
